{include file="inc/header_index_mui.html"}
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/aui.css"/>
		<link rel="stylesheet" href="css/icons-extra.css" />
		<link rel="stylesheet" href="css/shop_tc.css" />
		<script src="js/jquery-1.8.2.min.js"></script>
{include file="inc/footer_menu_mui.html"}		
	
		<!---->
		<div class="mui-content">
		    <div class="re"><img  class="aui-col-10 fix aui-light-top aui-zindex-9"  src="image/light.png" alt="" /></div>
		    <!--灯光效果-->
		    
		  	<ul class="mui-table-view aui-mar-t-15">
		  	    <li class="mui-table-view-cell">
		  	    	<a href="index.php?ctl=uc_msg&act=systems"><img class="aui-col-1"  src="image/chat_notice.png" alt="" /><span class="re rele">系统消息</span></a>
		  	  	</li>	  	  
		  	</ul>
		  	<ul class="mui-table-view">
		  	    <li class="mui-table-view-cell">
		  	    	<a href=""><img class="aui-col-1"  src="image/chat_mp.png" alt="" /><span class="re rele">我的门派</span></a>
		  	  	</li>	  	  
		  	</ul>
		  	<ul class="mui-table-view">
		  	    <li class="mui-table-view-cell">
		  	    	<a href="index.php?ctl=uc_msg&act=fujin"><img class="aui-col-1"  src="image/chat_fujin.png" alt="" /><span class="re rele">附近的人</span></a>
		  	  	</li>	  	  
		  	</ul>
			<ul class="mui-table-view">
				<li class="newfriend mui-table-view-cell">
					<img class="aui-col-1"  src="image/newfriend.png" alt="" /><span class="re rele">新的好友</span>
				</li>
			</ul>
			<!--系统消息 我的门派 附近的人-->
		  	
		  	<div class="mui-row aui-mar-t-15">
			    <div class="mui-col-sm-6 mui-col-xs-6  mui-text-right">
			    	<button class="nav_btn aui-border-radius aui-col-8 aui-background-lightblue aui-color-white" onclick="location.href='index.php?ctl=uc_msg'">最近好友</button>
			    </div>
			    <div class="mui-col-sm-6 mui-col-xs-6  mui-text-left">
			    	<button class=" aui-border-radius aui-col-8" onclick="location.href='index.php?ctl=uc_msg&act=all'" >全部好友</button>
			    </div>
			</div>
			<!--最近全部好友-->
			
			<ul class="mui-table-view aui-mar-t-15 recen_friend">
			{if $data.list}
				{foreach from=$data.list item=friend}
				<li class="mui-table-view-cell mui-media"> 
					<img  class="mui-media-object mui-pull-left" src="{$friend.user_logo}" />
					<div class="mui-media-body">
							<span >{$friend.user_name}</span>
							<p class="fr "><?php echo date("Y-m-d H:i:s",$this->_var['friend']['new_time']) ?></p>
						<p class="mui-ellipsis">{$friend.my_intro}</p>	  
					</div>	
				</li>
				{/foreach}
			{else}	
				暂无好友
			{/if}

			    </li>
			</ul>
		  	<!--最近好友结束-->
		</div>
		
		
		<!--弹窗-->
		<div class="alert_bg" >
			<div class="alert_zs alert_tc ab aui-pad-15 mui-text-center" style="width:80%;height:auto;display:none;">
				<h1 class="aui-color-white">添加好友</h1>
				<div class="aui-background-white aui-border-radius-30">
					<input type="number" style="width:80%;margin:0;border:none;" placeholder="请输入好友ID" id="search_user_id" />
					<img src="image/search.png" class="re input_id" style="top:5px;" onclick="search()" />
				</div>
		
				<div class="aui-pad-10 aui-mar-t-10 id" style="border-top:1px dotted #fff;display:none;">
					<div class="aui-color-white mui-text-left aui-pad-10 id1">*暂未信息</div>
					<div class="mui-row mui-text-left id2">
						<div class="mui-col-sm-3 mui-col-xs-3"><img src="" class="aui-col-8" id="id2_user_logo" /></div>
						<div class="mui-col-sm-9 mui-col-xs-9"><p class="f18" id="id2_user_name"></p><p class="f18">ID:<span id="id2_id"></span></p></div>
					</div>				
				</div>
				
				<div class="aui-mar-t-10">
					<button class="cancel mui-btn mui-btn-danger aui-border-radius-30 aui-col-3 aui-mar-r-10">取消</button>
					<button class="mui-btn mui-btn-warning aui-border-radius-30 aui-col-3" onclick="add_friend()">添加</button>
				</div>
			</div>
			<!--添加好友  弹窗-->
		</div>
</body>
<input type="hidden" id="isTrue" value="1">
<input type="hidden" id="adduserid" value="0">
<script>
	$(".nav_btn").each(function(i, e) {
		e.index = i;
		$(e).click(function() {
			$(".nav_btn").removeClass("aui-background-lightblue aui-color-white");
			$(this).addClass("aui-background-lightblue aui-color-white");
			if(e.index == 0) {
				$(".recen_friend").show();
				$(".all_friend").hide();
			} else {
				$(".recen_friend").hide();
				$(".all_friend").show();
			}
		})
	})
	
	$(".newfriend").click(function(){
		$(".alert_bg").show()
		$(".alert_zs").show()
	})
	$(".input_id").click(function(){
		$(".id").show()
	})
	$(".cancel").click(function(){
		$(".alert_bg").hide()
		$(".alert_zs").hide()
		$(".id").hide()
	})
function search(){
	$(".id").hide();
	$(".id1").hide();
	$(".id2").hide();
	var search_user_id=$("#search_user_id").val();

	if(search_user_id!=''){
		var isTrue = $("#isTrue").val();
		if(isTrue==1){
			$("#isTrue").val(0);
			$.ajax({
				url: 'index.php?ctl=user_center&act=search_user_id_tj',
				type: 'POST',
				data: 'search_user_id=' + search_user_id +'&t=' + Math.random(),
				dataType: "json",
				success: function (data) {
					if(data.status=="1"){
						console.log(data.info);
						$("#adduserid").val(data.info.id);
						$("#id2_user_logo").attr("src",data.info.user_logo);
						$("#id2_user_name").html(data.info.user_name);
						$("#id2_id").html(data.info.id);
						$("#zengsong_user_id").val(data.info.id);						
						$(".id2").show();		
					}else{
						$("#adduserid").val(0);
						$(".id1").html(data.info);
						$("#zengsong_user_id").val(0);
						$(".id1").show();
					}
					$(".id").show();
					$("#isTrue").val(1);
				},
				error: function () {
					//alert("系统错误，请联系管理员");
				}
			});	
		}		
	}else{
		alert("请输入好友id");
	}
}	
function add_friend(){
    var id=$("#adduserid").val();
	if(id>0){
		$.ajax({
			url: 'index.php?ctl=uc_msg&act=add_friend',
			type: 'POST',
			data: 'id=' + id + '&rnum=' + Math.random(),
			dataType: "json",
			success: function (data) {
				if(data.add_status==1){
					alert("添加成功，等待对方通过好友");
				}
				if(data.add_status==2){
					alert("你们已经是好友啦");
				}
				if(data.add_status==3){
					alert("等待对方通过好友");
				}
			},
			error: function () {
				alert("系统错误，请联系管理员");
			}
		});
	}else{
		alert("没有好友信息");
	}	
}
</script>
	
</html>


<?php/*
{include file="inc/header_other.html"}
<link href="css/common.css" rel="stylesheet"/>
<link href="css/chat.css" rel="stylesheet"/>

<section class="nav re">
    <p><a href="index.php?ctl=uc_msg&act=systems"><img src="image/cs_info.png" alt="">系统消息</a></p>
	<p><a href=""><img src="image/cs_mp.png" alt="">我的门派</a></p>
	<p><a href="index.php?ctl=uc_msg&act=fujin"><img src="image/cs_dz.png" alt="">附近的人</a></p>
</section>
<ul class="friends_bar">
	<li class="blue"><a href="index.php?ctl=uc_msg">最近好友</a></li>
	<li><a href="index.php?ctl=uc_msg&act=all">全部好友</a></li>
</ul>
<section class="friends">
{if $data.list}
	{foreach from=$data.list item=friend}
	<div class="list">     
		<img src="{$friend.user_logo}" alt="">
		<div class="fl">
			<h4>{$friend.user_name}</h4>
			<p class="cont">{$friend.my_intro}</p>
		</div>
		<span><?php echo date("Y-m-d H:i:s",$this->_var['friend']['new_time']) ?></span>
	</div>
	{/foreach}
{else}	
	暂无好友
{/if}
</section>

{include file="inc/footer_menu.html"}
*/?>